import request from "@/util/axios";

export const cnTeamPage = (data) =>
    request({
        url: "/api/cnTeam/page",
        method: "post",
        data
    })

export const saveCnTeam = (data) =>
    request({
        url: "/api/cnTeam/save",
        method: "post",
        data
    })

export const updateCnTeam = (data) =>
    request({
        url: "/api/cnTeam/update",
        method: "post",
        data
    })

export const cnTeamDt = (tId) =>
    request({
        url: "/api/cnTeam/dt",
        method: "get",
        params: {tId}
    })

export const cnTeamDeleted = (tid) =>
    request({
        url: "/api/cnTeam/deleted",
        method: "get",
        params: {tid}
    })

export const joinTeam = (tid, joinCode) =>
    request({
        url: "/api/cnTeam/join",
        method: "get",
        params: {tid, joinCode}
    })

export const teamMember = (tid) =>
    request({
        url: "/api/cnTeam/teamMember",
        method: "get",
        params: {tid}
    })

export const position = () =>
    request({
        url: "/api/cnTeam/position",
        method: "get",
    })

export const changePosition = (data) =>
    request({
        url: "/api/cnTeam/changePosition",
        method: "post",
        data: data
    })

export const removeMember = (tid, uid) =>
    request({
        url: "/api/cnTeam/removeMember",
        method: "get",
        params: {tid, uid}
    })

export const quitTeam = (tid) =>
    request({
        url: "/api/cnTeam/quitTeam",
        method: "get",
        params: {tid}
    })

export const queryJoinTeam = () =>
    request({
        url: "/api/cnTeam/queryJoinTeam",
        method: "get"
    })